AWSS3PutBucket
Type
command
Summary
Create a bucket.
Syntax
AWSS3PutBucket <pBucket>,<pCustomHeaders>,<pCallback>
Description
Not every string is an acceptable bucket name. For information on bucket naming restrictions, see Working with Amazon S3 Buckets.
The caller of this command will be sent the callback message on completion with two parameters:
- the request ID
- the response from the server which should be empty.
- an error message if one occurred
The message is sent before the tsNet connection is closed so it is possible to access the recieved headers using the tsNetRetrHeaders function
For futher details about this API including values for custom headers see the AWS S3 REST API Documentation
Parameters
Name | Type | Description |
---|---|---|
pBucket | The name of a bucket | |
pCustomHeaders | Use this array to specify additional request headers. For example
you may specify a pre-canned ACL by setting the
| |
pCallback | A command name to be sent on completion with the server reponse. |
Examples
local tCustomHeaders
put "public-read" into tCustomHeaders["x-amz-acl"]
put "REDUCED_REDUNDANCY" into tCustomHeaders["x-amz-storage-class"]
AWSS3PutBucket "mybucket", tCustomHeaders, "putBucketCallback"
put it into tRequestID
on putBucketCallback pRequestID, pResult, pError
if pError is empty then
answer "Bucket created"
end if
end putBucketCallback
Related
function: tsNetGetStatus, tsNetRetrHeaders
library: tsNet